import com.yny.spring.student.controller.UserService;
import com.spring.student.register.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

public class li{
    @Test
    public void test1() {
        ApplicationContext hong;
        hong = new ClassPathXmlApplicationContext("register.xml"); //resources内文件没有后缀
        User user = (User)hong.getBean("user");

        UserService userController = hong
                .getBean("userService",
                        UserService.class);
        System.out.println("请学生进行账号注册");
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入学号");
        String number = scan.next();
        System.out.println("请输入密码");
        String password = scan.next();
        user.setNumber(number);
        user.setPassword(password);
        System.out.println(user);




    }
}